#ifndef WXSENUMPROPERTY_H
#define WXSENUMPROPERTY_H

#include "wxsproperty.h"


class wxsEnumProperty: public wxsProperty {
  public:


    wxsEnumProperty(
      const wxString& PGName,
      const wxString& DataName,
      long Offset,
      const long* Values,
      const wxChar** Names,
      bool UpdateEntries = false,
      long Default = 0,
      bool UseNamesInXml = false,
      int Priority = 100 );

  protected:

    virtual const wxString GetTypeName() { return _T( "" ); }
    virtual void PGCreate( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Parent );
    virtual bool PGRead( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Id, long Index );
    virtual bool PGWrite( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Id, long Index );
    virtual bool XmlRead( wxsPropertyContainer* Object, TiXmlElement* Element );
    virtual bool XmlWrite( wxsPropertyContainer* Object, TiXmlElement* Element );
    virtual bool PropStreamRead( wxsPropertyContainer* Object, wxsPropertyStream* Stream );
    virtual bool PropStreamWrite( wxsPropertyContainer* Object, wxsPropertyStream* Stream );

  private:
    long Offset;
    long Default;
    bool UpdateEntries;
    const long* Values;
    const wxChar** Names;
    bool UseNamesInXml;
};




#define WXS_ENUM(ClassName,VarName,PGName,DataName,Values,Names,Default) \
  { static wxsEnumProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),Values,Names,false,Default,true); \
    Property(_Property); }


#define WXS_ENUM_P(ClassName,VarName,PGName,DataName,Values,Names,Default,Priority) \
  { static wxsEnumProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),Values,Names,false,Default,true,Priority); \
    Property(_Property); }



#endif
